//show date on home page
function showDate() {
	var today = new Date();
	var thisHours = today.getHours();
	var thisMinutes = today.getMinutes();
	var monthNamesR = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'];
	var thisDay = today.getDay();
	var thisDate = today.getDate();
	var currMonth = today.getMonth();
	var currYear = today.getFullYear();
	var a = "AM";
	if(today.getMinutes() < 10) {thisMinutes = "0" + today.getMinutes()};
	if(today.getHours() > 12) {thisHours = today.getHours() - 12; a = "PM"};
	var strDate = thisHours + ":" + thisMinutes + " " + a + " - " + thisDate + "/" + monthNamesR[currMonth]  + "/" + currYear;
	document.getElementById('time').innerHTML = strDate;
}
function geturl(addr) {
 	var r = $.ajax({
  			type: 'GET',
  			url: addr,
  			async: false
 	}).responseText;
 	return r;
}
//text box
function textboxFocus(el, defaultValue) {
	if ( defaultValue != null )	{
		if ( el.value == defaultValue ) {
			el.value = '';
		}
	}
}
function textboxBlur(el, defaultValue) {
	if ( defaultValue != null )	{
		if ( el.value == '' ) {
			el.value = defaultValue;
		}
	}
}
function findValue(li) {
	if( li == null ) return ;
	// if coming from an AJAX call, let's use the CityId as the value
	if( !!li.extra ) var sValue = li.extra[0];
	// otherwise, let's just display the value in the text box
	else var sValue = li.selectValue;
	//alert("The value you selected was: " + sValue);
}

function selectItem(li) {
	findValue(li);
	try {
		doSearchMaCK();
	}
	catch(ex) {
	}
}

function formatItem(row) {
	return row[0] + "-" + row[1];
	//return row[0];
}
/*
function lookupAjax(){
	var oSuggest = $("#companyCode")[0].autocompleter;
	oSuggest.findValue();
	return false;
}

function lookupLocal(){
	var oSuggest = $("#companyCode")[0].autocompleter;
	oSuggest.findValue();
	return false;
}
*/